"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var express = require("express");
var path_1 = require("path");
var module_map_ngfactory_loader_1 = require("@nguniversal/module-map-ngfactory-loader");
var express_engine_1 = require("@nguniversal/express-engine");
var DIST_FOLDER = path_1.join(__dirname, 'mobile/browser');
var _a = require('./mobile/server/main.js'), AppServerModuleNgFactory = _a.AppServerModuleNgFactory, LAZY_MODULE_MAP = _a.LAZY_MODULE_MAP;
exports.SERVER_ROOT = __dirname;
exports.htmlEngine = express_engine_1.ngExpressEngine({
    bootstrap: AppServerModuleNgFactory,
    providers: [
        module_map_ngfactory_loader_1.provideModuleMap(LAZY_MODULE_MAP)
    ]
});
function createHtmlEngine() {
    var expressApp = express();
    expressApp.engine('html', exports.htmlEngine);
    expressApp.set('view engine', 'html');
    expressApp.set('views', path_1.join(DIST_FOLDER));
    expressApp.get('*.*', express.static(path_1.join(DIST_FOLDER), {
        maxAge: 0
    }));
    return expressApp;
}
exports.createHtmlEngine = createHtmlEngine;
